﻿namespace Fiddler
{
    using System;
    using System.Security.Cryptography;
    using System.Text;

    internal class WebSocketUtility
    {
        internal static string ComputeAcceptKey(string sSecWebSocketKeyFromClient)
        {
            SHA1 sha = SHA1.Create();
            string str = Convert.ToBase64String(sha.ComputeHash(Encoding.ASCII.GetBytes(sSecWebSocketKeyFromClient + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11")));
            sha.Clear();
            return str;
        }
    }
}

